/********************************************************************************
 *      Copyright:  (C) 2020 Tang Zhiqiang<t_zhiqiang@163.com>
 *                  All rights reserved.
 *
 *       Filename:  client_list.h
 *    Description:  This head file list strcut head.
 *
 *        Version:  1.0.0(05/04/2020)
 *         Author:  Tang Zhiqiang <t_zhiqiang@163.com>
 *      ChangeLog:  1, Release initial version on "05/04/2020 09:31:33 PM"
 *                 
 ********************************************************************************/

#ifndef CLIENT_LIST_H 
#define CLIENT_LIST_H

#include "tlv.h"

typedef struct client_list_s
{
    int                     offset;     //buf剩余数据偏移量
    int                     fd;         //client的fd
    unsigned char           buf[1024];  //存放服务器读取的数据
    struct tlv_total        data_p;     //存放tlv解析的id，time，temper数据
    struct client_list_s    *next;      //list的指针
}client_list_t;           //用于连接新的客户端

client_list_t *create_list();
client_list_t *find_node(client_list_t *head, int fd);
client_list_t *add_list_to_tail(client_list_t *head,int fd);  //  head形参为引用类型

void print_list(client_list_t *head);
void delete_node(client_list_t *head, int fd);
void destory_list(client_list_t **head);

#endif 

